package Library.Login;

import Library.*;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.rmi.*;

//TODO: [LIBRARY#07] [JAVADOC] javadoc missing
/**
 *
 */
public interface ILoginServer extends Remote
{

    /**
     *
     * @param ticket
     * @throws RemoteException
     * @throws Exception
     */
    void logout(ITicket ticket) throws RemoteException, Exception;
    
    /**
     * //TODO: [LIBRARY#08] [JAVADOC] javadoc missing
     * @param username
     * @param password
     * @return 
     * @throws RemoteException
     * @throws NoSuchAlgorithmException
     * @throws UnsupportedEncodingException
     * @throws Exception
     */
    ActionResult<ITicket> login(String username, int password) throws RemoteException,
            NoSuchAlgorithmException, UnsupportedEncodingException, Exception;

    /**
     * Maakt met behulp van een username en password een account aan. Controle
     * op dubbele accounts zit in de database. Als creatie in database lukt,
     * wordt account toegevoegd aan list m_accounts en True teruggegeven.
     * @param username
     * @param password
     * @return succesvol
     * @throws RemoteException
     * @throws NoSuchAlgorithmException
     * @throws UnsupportedEncodingException
     */
    int createAccount(String username, int password)
            throws RemoteException, UnsupportedEncodingException,
            NoSuchAlgorithmException;
}